﻿//创建时间: 2010-12-10
//创建作者: 李 城
//功能说明: 评论模块
//最后修改: 2010-12-10
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Reflection;

using TRPOP.Common;
using TRPOP.CMS.Model;

namespace TRPOP.CMS.DALFactory
{
    public interface IRecomDAL
    {

        ///	<summary>
        ///	保存
        ///	</summary>
        ///	<param name="RecomInfo"></param>
        ///	<returns>EnumSubmitResult</returns>
        EnumSubmitResult Save(RecomInfo info);

        ///	<summary>
        ///	获取实体
        ///	</summary>
        ///	<param name="recommendId"></param>
        ///	<returns>RecomInfo</returns>
        RecomInfo GetInfoById(int id);

        ///	<summary>
        ///	删除
        ///	</summary>
        ///	<param name="id"></param>
        ///	<returns>EnumSubmitResult</returns>
        EnumSubmitResult DeleteInfoById(int id);

        ///	<summary>
        ///	删除
        ///	</summary>
        ///	<param name="ids"></param>
        ///	<returns>EnumSubmitResult</returns>
        EnumSubmitResult DeleteInfoByIds(string ids);

        ///	<summary>
        ///	自定义列表（无分页）
        ///	</summary>
        ///	<param name="topn">前N条，为0时表示所有符合条件的</param>
        ///	<param name="condition">自定义条件，要以And开头</param>
        ///	<param name="orderby">排序，不需要Order by </param>
        ///	<returns>List<RecomInfo></returns>
        List<RecomInfo> GetListByCondition(int topn, string condition, string orderby);

        ///	<summary>
        ///	自定义列表（分页）
        ///	</summary>
        ///	<returns>List<RecomInfo></returns>
        List<RecomInfo> GetListByPager(int pageNumber, int pageSize, string condition, string orderby, out int recordCount);
        /// <summary>
        /// 级联评论相关的表，获取相关数据
        /// </summary>
        /// <param name="NodeID"></param>
        /// <param name="intPageNum"></param>
        /// <param name="intPageSize"></param>
        /// <param name="intRecount"></param>
        /// <returns></returns>
        DataTable GetRecommentDT(int NodeID, int intPageNum, int intPageSize, out int intRecount);
        DataTable GetRecommentDT(int NodeID, int intPageNum, int intPageSize, out int intRecount, int intContentID, DateTime timeStart, DateTime timeEnd);
        DataTable GetRecommentDT(int NodeID, int intPageNum, int intPageSize, out int intRecount, int intContentID, DateTime timeStart, DateTime timeEnd, string strSQLNodeIDsCondation);
        /// <summary>
        /// 获取信息的评论数 
        /// </summary>
        /// <param name="intIndexid"></param>
        /// <returns></returns>
        int GetContentRecCount(int intIndexid);

        /// <summary>
        /// 获取结点的评论数
        /// </summary>
        /// <param name="intNodeid"></param>
        /// <returns></returns>
        int GetNodeRecCount(int intNodeid);

    }


    public sealed partial class DataAccess
    {
        public static IRecomDAL CreateRecomDAL()
        {
            string className = path + ".RecomDAL";
            return (IRecomDAL)Assembly.Load(path).CreateInstance(className);
        }
    }
}

